Optimal. Leaf size=156 \[ \frac {e g p \log \left (d+e x^n\right )}{f^2 (d f-e g) n}+\frac {g \log \left (c \left (d+e x^n\right )^p\right )}{f^2 n \left (g+f x^n\right )}-\frac {e g p \log \left (g+f x^n\right )}{f^2 (d f-e g) n}+\frac {\log \left (c \left (d+e x^n\right )^p\right ) \log \left (-\frac {e \left (g+f x^n\right )}{d f-e g}\right )}{f^2 n}+\frac {p \text {Li}_2\left (\frac {f \left (d+e x^n\right )}{d f-e g}\right )}{f^2 n} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 156, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 10, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.370, Rules used = {2525, 269,
45, 2463, 2442, 36, 31, 2441, 2440, 2438} \begin {gather*} \frac {p \text {PolyLog}\left (2,\frac {f \left (d+e x^n\right )}{d f-e g}\right )}{f^2 n}+\frac {g \log \left (c \left (d+e x^n\right )^p\right )}{f^2 n \left (f x^n+g\right )}+\frac {\log \left (c \left (d+e x^n\right )^p\right ) \log \left (-\frac {e \left (f x^n+g\right )}{d f-e g}\right )}{f^2 n}+\frac {e g p \log \left (d+e x^n\right )}{f^2 n (d f-e g)}-\frac {e g p \log \left (f x^n+g\right )}{f^2 n (d f-e g)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 36
Rule 45
Rule 269
Rule 2438
Rule 2440
Rule 2441
Rule 2442
Rule 2463
Rule 2525
Rubi steps
\begin {align*} \int \frac {\log \left (c \left (d+e x^n\right )^p\right )}{x \left (f+g x^{-n}\right )^2} \, dx &=\frac {\text {Subst}\left (\int \frac {\log \left (c (d+e x)^p\right )}{\left (f+\frac {g}{x}\right )^2 x} \, dx,x,x^n\right )}{n}\\ &=\frac {\text {Subst}\left (\int \left (-\frac {g \log \left (c (d+e x)^p\right )}{f (g+f x)^2}+\frac {\log \left (c (d+e x)^p\right )}{f (g+f x)}\right ) \, dx,x,x^n\right )}{n}\\ &=\frac {\text {Subst}\left (\int \frac {\log \left (c (d+e x)^p\right )}{g+f x} \, dx,x,x^n\right )}{f n}-\frac {g \text {Subst}\left (\int \frac {\log \left (c (d+e x)^p\right )}{(g+f x)^2} \, dx,x,x^n\right )}{f n}\\ &=\frac {g \log \left (c \left (d+e x^n\right )^p\right )}{f^2 n \left (g+f x^n\right )}+\frac {\log \left (c \left (d+e x^n\right )^p\right ) \log \left (-\frac {e \left (g+f x^n\right )}{d f-e g}\right )}{f^2 n}-\frac {(e p) \text {Subst}\left (\int \frac {\log \left (\frac {e (g+f x)}{-d f+e g}\right )}{d+e x} \, dx,x,x^n\right )}{f^2 n}-\frac {(e g p) \text {Subst}\left (\int \frac {1}{(d+e x) (g+f x)} \, dx,x,x^n\right )}{f^2 n}\\ &=\frac {g \log \left (c \left (d+e x^n\right )^p\right )}{f^2 n \left (g+f x^n\right )}+\frac {\log \left (c \left (d+e x^n\right )^p\right ) \log \left (-\frac {e \left (g+f x^n\right )}{d f-e g}\right )}{f^2 n}-\frac {p \text {Subst}\left (\int \frac {\log \left (1+\frac {f x}{-d f+e g}\right )}{x} \, dx,x,d+e x^n\right )}{f^2 n}+\frac {\left (e^2 g p\right ) \text {Subst}\left (\int \frac {1}{d+e x} \, dx,x,x^n\right )}{f^2 (d f-e g) n}-\frac {(e g p) \text {Subst}\left (\int \frac {1}{g+f x} \, dx,x,x^n\right )}{f (d f-e g) n}\\ &=\frac {e g p \log \left (d+e x^n\right )}{f^2 (d f-e g) n}+\frac {g \log \left (c \left (d+e x^n\right )^p\right )}{f^2 n \left (g+f x^n\right )}-\frac {e g p \log \left (g+f x^n\right )}{f^2 (d f-e g) n}+\frac {\log \left (c \left (d+e x^n\right )^p\right ) \log \left (-\frac {e \left (g+f x^n\right )}{d f-e g}\right )}{f^2 n}+\frac {p \text {Li}_2\left (\frac {f \left (d+e x^n\right )}{d f-e g}\right )}{f^2 n}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(433\) vs. \(2(156)=312\).
time = 1.13, size = 433, normalized size = 2.78 \begin {gather*} \frac {g p \log \left (f-f x^{-n}\right )+f p x^n \log \left (f-f x^{-n}\right )-g n p \log (x) \log \left (f-f x^{-n}\right )-f n p x^n \log (x) \log \left (f-f x^{-n}\right )-p \log \left (e+d x^{-n}\right ) \left (-f x^n+\left (g+f x^n\right ) \log \left (f-f x^{-n}\right )\right )-f x^n \log \left (c \left (d+e x^n\right )^p\right )+g \log \left (f-f x^{-n}\right ) \log \left (c \left (d+e x^n\right )^p\right )+f x^n \log \left (f-f x^{-n}\right ) \log \left (c \left (d+e x^n\right )^p\right )+g n p \log (x) \log \left (1+\frac {f x^n}{g}\right )+f n p x^n \log (x) \log \left (1+\frac {f x^n}{g}\right )+p \left (g+f x^n\right ) \text {Li}_2\left (-\frac {f x^n}{g}\right )}{f^2 n \left (g+f x^n\right )}-\frac {p \left (-\frac {d f \log \left (e+d x^{-n}\right )}{d f-e g}+\frac {f x^n \log \left (e+d x^{-n}\right )}{g+f x^n}+\log \left (-\frac {d x^{-n}}{e}\right ) \log \left (e+d x^{-n}\right )+\frac {d f \log \left (f+g x^{-n}\right )}{d f-e g}-\log \left (e+d x^{-n}\right ) \log \left (\frac {d \left (f+g x^{-n}\right )}{d f-e g}\right )-\text {Li}_2\left (-\frac {g \left (e+d x^{-n}\right )}{d f-e g}\right )+\text {Li}_2\left (1+\frac {d x^{-n}}{e}\right )\right )}{f^2 n} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 1.09, size = 589, normalized size = 3.78
method | result | size |
risch | \(\frac {\ln \left (\left (d +e \,x^{n}\right )^{p}\right ) g}{n \,f^{2} \left (g +f \,x^{n}\right )}+\frac {\ln \left (\left (d +e \,x^{n}\right )^{p}\right ) \ln \left (g +f \,x^{n}\right )}{n \,f^{2}}-\frac {p \dilog \left (\frac {\left (g +f \,x^{n}\right ) e +d f -e g}{d f -e g}\right )}{n \,f^{2}}-\frac {p \ln \left (g +f \,x^{n}\right ) \ln \left (\frac {\left (g +f \,x^{n}\right ) e +d f -e g}{d f -e g}\right )}{n \,f^{2}}-\frac {e g p \ln \left (g +f \,x^{n}\right )}{f^{2} \left (d f -e g \right ) n}+\frac {p e g \ln \left (\left (g +f \,x^{n}\right ) e +d f -e g \right )}{n \,f^{2} \left (d f -e g \right )}-\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{3} \ln \left (g +f \,x^{n}\right )}{2 n \,f^{2}}-\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{3} g}{2 n \,f^{2} \left (g +f \,x^{n}\right )}-\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \right ) g}{2 n \,f^{2} \left (g +f \,x^{n}\right )}+\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} g}{2 n \,f^{2} \left (g +f \,x^{n}\right )}-\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \right ) \ln \left (g +f \,x^{n}\right )}{2 n \,f^{2}}+\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} \mathrm {csgn}\left (i c \right ) g}{2 n \,f^{2} \left (g +f \,x^{n}\right )}+\frac {i \pi \,\mathrm {csgn}\left (i \left (d +e \,x^{n}\right )^{p}\right ) \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} \ln \left (g +f \,x^{n}\right )}{2 n \,f^{2}}+\frac {i \pi \mathrm {csgn}\left (i c \left (d +e \,x^{n}\right )^{p}\right )^{2} \mathrm {csgn}\left (i c \right ) \ln \left (g +f \,x^{n}\right )}{2 n \,f^{2}}+\frac {\ln \left (c \right ) g}{n \,f^{2} \left (g +f \,x^{n}\right )}+\frac {\ln \left (c \right ) \ln \left (g +f \,x^{n}\right )}{n \,f^{2}}\) | \(589\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.41, size = 222, normalized size = 1.42 \begin {gather*} n p {\left (\frac {d \log \left ({\left (d + e^{\left (n \log \left (x\right ) + 1\right )}\right )} e^{\left (-1\right )}\right )}{d f^{2} n^{2} e - f g n^{2} e^{2}} - \frac {g \log \left (\frac {f x^{n} + g}{f}\right )}{d f^{3} n^{2} - f^{2} g n^{2} e} - \frac {{\left (\log \left (f x^{n} + g\right ) \log \left (\frac {g e + f e^{\left (n \log \left (x\right ) + 1\right )}}{d f - g e} + 1\right ) + {\rm Li}_2\left (-\frac {g e + f e^{\left (n \log \left (x\right ) + 1\right )}}{d f - g e}\right )\right )} e^{\left (-1\right )}}{f^{2} n^{2}}\right )} e - {\left (\frac {1}{f^{2} n + \frac {f g n}{x^{n}}} - \frac {\log \left (f + \frac {g}{x^{n}}\right )}{f^{2} n} + \frac {\log \left (\frac {1}{x^{n}}\right )}{f^{2} n}\right )} \log \left ({\left (x^{n} e + d\right )}^{p} c\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\ln \left (c\,{\left (d+e\,x^n\right )}^p\right )}{x\,{\left (f+\frac {g}{x^n}\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________